package com.opengl.camera;

import android.graphics.Point;
import android.hardware.Camera;

/**
 * Camera preview size parameters.
 * These parameters are used when setting up the camera for 
 * the camera preview callback function.
 * @author schu
 *
 */
public class CameraParams 
{
	// cols, rows
	static final Point cameraSize = new Point(320, 240);
	static final float cameraAspectRatio = (float) cameraSize.y / (float) cameraSize.x;
	static final int textureSize = nextPowerOf2(cameraSize.x);
	static final float sensorWidthMM = 4.6f;
	static Camera.Parameters cameraParams = null;


	public static int nextPowerOf2(final int a)
	{
		int b = 1;
		while (b < a)
		{
			b = b << 1;
		}
		return b;
	}
}


